home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / syntax / fvwm.vim < prev    next >
Encoding:
Text File  |  2001-04-29  |  12.3 KB  |  258 lines

  1. " Vim syntax file
  2. " Language:    Fvwm{1,2} configuration file
  3. " Maintainer:    Haakon Riiser <haakon@riiser.net>
  4. " Last Change:    2001 Apr 25
  5.  
  6. " For version 5.x: Clear all syntax items
  7. " For version 6.x: Quit when a syntax file was already loaded
  8. if version < 600
  9.     syn clear
  10. elseif exists("b:current_syntax")
  11.     finish
  12. endif
  13.  
  14. " Fvwm configuration files are case insensitive
  15. syn case ignore
  16.  
  17. if version >= 600
  18.     setlocal iskeyword=_,-,+,.,a-z,A-Z,48-57
  19. else
  20.     set iskeyword=_,-,+,.,a-z,A-Z,48-57
  21. endif
  22.  
  23. " Read system colors from the color database (rgb.txt)
  24. if exists("rgb_file")
  25.     " We don't want any hit-return prompts, so we make sure that
  26.     " &shortmess is set to `O'
  27.     let __fvwm_oldshm = &shortmess
  28.     set shortmess=O
  29.  
  30.     " And we set &report to a huge number, so that no hit-return prompts
  31.     " will be given
  32.     let __fvwm_oldreport = &report
  33.     set report=10000
  34.  
  35.     " Append the color database to the fvwm configuration, and read the
  36.     " colors from this buffer
  37.     let __fvwm_i = line("$") + 1
  38.     exe "$r" rgb_file
  39.     let __fvwm_lastline = line("$")
  40.     while __fvwm_i <= __fvwm_lastline
  41.     let __fvwm_s = matchstr(getline(__fvwm_i), '^\s*\d\+\s\+\d\+\s\+\d\+\s\+\h.*$')
  42.     if __fvwm_s != ""
  43.         exe "syn keyword fvwmColors ".substitute(__fvwm_s, '^\s*\d\+\s\+\d\+\s\+\d\+\s\+\(\h.*\)$', '\1', "")
  44.     endif
  45.     let __fvwm_i = __fvwm_i + 1
  46.     endwhile
  47.  
  48.     " Remove the appended data
  49.     undo
  50.  
  51.     " Goto first line again
  52.     1
  53.  
  54.     " and restore the old values of the variables
  55.     let &shortmess = __fvwm_oldshm
  56.     let &report = __fvwm_oldreport
  57.     unlet __fvwm_i __fvwm_s __fvwm_lastline __fvwm_oldshm __fvwm_oldreport
  58. endif
  59. " done reading colors
  60.  
  61. syn match   fvwmWhitespace    "\s\+" contained
  62. syn match   fvwmEnvVar        "\$\w\+"
  63. syn match   fvwmModConf        "^\s*\*\a\+" contains=fvwmWhitespace
  64. syn match   fvwmString        '".\{-}"'
  65. syn match   fvwmRGBValue    "#\x\{3}"
  66. syn match   fvwmRGBValue    "#\x\{6}"
  67. syn match   fvwmRGBValue    "#\x\{9}"
  68. syn match   fvwmRGBValue    "#\x\{12}"
  69. syn match   fvwmRGBValue    "rgb:\x\{1,4}/\x\{1,4}/\x\{1,4}"
  70. syn match   fvwmPath        "\<IconPath\s.*$"lc=8 contains=fvwmEnvVar
  71. syn match   fvwmPath        "\<ModulePath\s.*$"lc=10 contains=fvwmEnvVar
  72. syn match   fvwmPath        "\<PixmapPath\s.*$"lc=10 contains=fvwmEnvVar
  73. syn match   fvwmModule        "\<Module\s\+\w\+"he=s+6
  74. syn match   fvwmKey        "\<Key\s\+\w\+"he=s+3
  75. syn keyword fvwmExec        Exec
  76. syn match   fvwmComment        "^#.*$"
  77.  
  78. if (exists("b:fvwm_version") && b:fvwm_version == 1) || (exists("use_fvwm_1") && use_fvwm_1)
  79.     syn match  fvwmEnvVar    "\$(\w\+)"
  80.     syn region fvwmStyle    matchgroup=fvwmFunction start="^\s*Style\>"hs=e-5 end="$" oneline keepend contains=fvwmString,fvwmKeyword,fvwmWhiteSpace
  81.  
  82.     syn keyword fvwmFunction    AppsBackingStore AutoRaise BackingStore
  83.     syn keyword fvwmFunction    Beep BoundaryWidth ButtonStyle
  84.     syn keyword fvwmFunction    CenterOnCirculate CirculateDown
  85.     syn keyword fvwmFunction    CirculateHit CirculateSkip
  86.     syn keyword fvwmFunction    CirculateSkipIcons CirculateUp
  87.     syn keyword fvwmFunction    ClickTime ClickToFocus Close Cursor
  88.     syn keyword fvwmFunction    CursorMove DecorateTransients Delete
  89.     syn keyword fvwmFunction    Desk DeskTopScale DeskTopSize Destroy
  90.     syn keyword fvwmFunction    DontMoveOff EdgeResistance EdgeScroll
  91.     syn keyword fvwmFunction    EndFunction EndMenu EndPopup Focus
  92.     syn keyword fvwmFunction    Font Function GotoPage HiBackColor
  93.     syn keyword fvwmFunction    HiForeColor Icon IconBox IconFont
  94.     syn keyword fvwmFunction    Iconify IconPath Key Lenience Lower
  95.     syn keyword fvwmFunction    Maximize MenuBackColor MenuForeColor
  96.     syn keyword fvwmFunction    MenuStippleColor Module ModulePath Mouse
  97.     syn keyword fvwmFunction    Move MWMBorders MWMButtons MWMDecorHints
  98.     syn keyword fvwmFunction    MWMFunctionHints MWMHintOverride MWMMenus
  99.     syn keyword fvwmFunction    NoBorder NoBoundaryWidth Nop NoPPosition
  100.     syn keyword fvwmFunction    NoTitle OpaqueMove OpaqueResize Pager
  101.     syn keyword fvwmFunction    PagerBackColor PagerFont PagerForeColor
  102.     syn keyword fvwmFunction    PagingDefault PixmapPath Popup Quit Raise
  103.     syn keyword fvwmFunction    RaiseLower RandomPlacement Refresh Resize
  104.     syn keyword fvwmFunction    Restart SaveUnders Scroll SloppyFocus
  105.     syn keyword fvwmFunction    SmartPlacement StartsOnDesk StaysOnTop
  106.     syn keyword fvwmFunction    StdBackColor StdForeColor Stick Sticky
  107.     syn keyword fvwmFunction    StickyBackColor StickyForeColor
  108.     syn keyword fvwmFunction    StickyIcons StubbornIconPlacement
  109.     syn keyword fvwmFunction    StubbornIcons StubbornPlacement
  110.     syn keyword fvwmFunction    SuppressIcons Title TogglePage Wait Warp
  111.     syn keyword fvwmFunction    WindowFont WindowList WindowListSkip
  112.     syn keyword fvwmFunction    WindowsDesk WindowShade XORvalue
  113.  
  114.     " These keywords are only used after the "Style" command.  To avoid
  115.     " name collision with several commands, they are contained.
  116.     syn keyword fvwmKeyword    BackColor BorderWidth BoundaryWidth contained
  117.     syn keyword fvwmKeyword    Button CirculateHit CirculateSkip Color contained
  118.     syn keyword fvwmKeyword    DoubleClick ForeColor Handles HandleWidth contained
  119.     syn keyword fvwmKeyword    Icon IconTitle NoBorder NoBoundaryWidth contained
  120.     syn keyword fvwmKeyword    NoButton NoHandles NoIcon NoIconTitle contained
  121.     syn keyword fvwmKeyword    NoTitle Slippery StartIconic StartNormal contained
  122.     syn keyword fvwmKeyword    StartsAnyWhere StartsOnDesk StaysOnTop contained
  123.     syn keyword fvwmKeyword    StaysPut Sticky Title WindowListHit contained
  124.     syn keyword fvwmKeyword    WindowListSkip contained
  125. elseif (exists("b:fvwm_version") && b:fvwm_version == 2) || (exists("use_fvwm_2") && use_fvwm_2)
  126.     syn match   fvwmEnvVar    "\${\w\+}"
  127.     syn match   fvwmDef        '^\s*+\s*".\{-}"' contains=fvwmMenuString,fvwmWhitespace
  128.     syn match   fvwmIcon    '%.\{-}%' contained
  129.     syn match   fvwmIcon    '\*.\{-}\*' contained
  130.     syn match   fvwmMenuString    '".\{-}"' contains=fvwmIcon,fvwmShortcutKey contained
  131.     syn match   fvwmShortcutKey    "&." contained
  132.     syn match   fvwmModule    "\<KillModule\s\+\w\+"he=s+10
  133.     syn match   fvwmModule    "\<SendToModule\s\+\w\+"he=s+12
  134.     syn match   fvwmModule    "\<DestroyModuleConfig\s\+\w\+"he=s+19
  135.  
  136.     syn keyword fvwmFunction    AddButtonStyle AddTitleStyle AddToDecor
  137.     syn keyword fvwmFunction    AddToFunc AddToMenu AnimatedMove Beep
  138.     syn keyword fvwmFunction    BorderStyle ButtonStyle ChangeDecor
  139.     syn keyword fvwmFunction    ChangeMenuStyle ClickTime Close
  140.     syn keyword fvwmFunction    ColorLimit ColormapFocus Current
  141.     syn keyword fvwmFunction    CursorMove CursorStyle DefaultColors
  142.     syn keyword fvwmFunction    DefaultFont Delete Desk DeskTopSize
  143.     syn keyword fvwmFunction    Destroy DestroyDecor DestroyFunc
  144.     syn keyword fvwmFunction    DestroyMenu DestroyMenuStyle Direction
  145.     syn keyword fvwmFunction    Echo EdgeResistance EdgeScroll
  146.     syn keyword fvwmFunction    EdgeThickness Emulate ExecUseShell
  147.     syn keyword fvwmFunction    ExitFunction FlipFocus Focus Function
  148.     syn keyword fvwmFunction    GlobalOpts GotoPage HilightColor IconFont
  149.     syn keyword fvwmFunction    Iconify IconPath Lower Maximize Menu
  150.     syn keyword fvwmFunction    MenuStyle ModulePath Mouse Move MoveToDesk
  151.     syn keyword fvwmFunction    MoveToPage Next None Nop OpaqueMoveSize
  152.     syn keyword fvwmFunction    PipeRead PixmapPath Popup Prev Quit
  153.     syn keyword fvwmFunction    QuitScreen Raise RaiseLower Read Recapture
  154.     syn keyword fvwmFunction    Refresh RefreshWindow Resize Restart
  155.     syn keyword fvwmFunction    Scroll SetAnimation SetEnv SetMenuDelay
  156.     syn keyword fvwmFunction    SetMenuStyle SnapAttraction SnapGrid
  157.     syn keyword fvwmFunction    Stick Style Title TitleStyle UpdateDecor
  158.     syn keyword fvwmFunction    Wait WarpToWindow WindowFont WindowId
  159.     syn keyword fvwmFunction    WindowList WindowsDesk WindowShade
  160.     syn keyword fvwmFunction    XORvalue
  161.  
  162.     syn keyword fvwmKeyword    Active ActiveDown ActiveFore
  163.     syn keyword fvwmKeyword    ActiveForeOff ActivePlacement
  164.     syn keyword fvwmKeyword    ActivePlacementHonorsStartsOnPage
  165.     syn keyword fvwmKeyword    ActivePlacementIgnoresStartsOnPage
  166.     syn keyword fvwmKeyword    ActiveUp All Alphabetic Animation
  167.     syn keyword fvwmKeyword    AnimationOff BackColor Background
  168.     syn keyword fvwmKeyword    BGradient BorderWidth Bottom
  169.     syn keyword fvwmKeyword    Button CaptureHonorsStartsOnPage
  170.     syn keyword fvwmKeyword    CaptureIgnoresStartsOnPage Centered
  171.     syn keyword fvwmKeyword    CirculateHit CirculateHitIcon
  172.     syn keyword fvwmKeyword    CirculateSkip CirculateSkipIcon Clear
  173.     syn keyword fvwmKeyword    ClickToFocus ClickToFocusDoesntPassClick
  174.     syn keyword fvwmKeyword    ClickToFocusDoesntRaise
  175.     syn keyword fvwmKeyword    ClickToFocusPassesClick ClickToFocusRaises
  176.     syn keyword fvwmKeyword    Color CurrentDesk CurrentPage
  177.     syn keyword fvwmKeyword    CurrentPageAnyDesk DecorateTransient
  178.     syn keyword fvwmKeyword    Default DGradient DoubleClickTime Down
  179.     syn keyword fvwmKeyword    DumbPlacement East Flat FocusFollowsMouse
  180.     syn keyword fvwmKeyword    FollowsFocus FollowsMouse Font ForeColor
  181.     syn keyword fvwmKeyword    Foreground FVWM FvwmBorder FvwmButtons
  182.     syn keyword fvwmKeyword    Greyed Handles HandleWidth Height
  183.     syn keyword fvwmKeyword    HGradient HiddenHandles Hilight3DOff
  184.     syn keyword fvwmKeyword    Hilight3DThick Hilight3DThin HilightBack
  185.     syn keyword fvwmKeyword    HilightBackOff HintOverride Icon IconBox
  186.     syn keyword fvwmKeyword    IconFill IconGrid Iconic Icons IconTitle
  187.     syn keyword fvwmKeyword    Inactive Interior Item Left LeftJustified
  188.     syn keyword fvwmKeyword    Lenience Maximized MenuFace MiniIcon
  189.     syn keyword fvwmKeyword    MouseFocus MouseFocusClickDoesntRaise
  190.     syn keyword fvwmKeyword    MouseFocusClickRaises MWM MWMBorder
  191.     syn keyword fvwmKeyword    MWMButtons MWMDecor MWMDecorMax
  192.     syn keyword fvwmKeyword    MWMDecorMenu MWMDecorMin MWMFunctions
  193.     syn keyword fvwmKeyword    NakedTransient NoButton NoDecorHint
  194.     syn keyword fvwmKeyword    NoDeskSort NoFuncHint NoGeometry
  195.     syn keyword fvwmKeyword    NoHandles NoIcon NoIcons NoIconTitle
  196.     syn keyword fvwmKeyword    NoInset NoLenience NoNormal NoOLDecor
  197.     syn keyword fvwmKeyword    NoOnTop NoOverride NoPPosition
  198.     syn keyword fvwmKeyword    Normal North Northeast Northwest
  199.     syn keyword fvwmKeyword    NoSticky NoStipledTitles NotAlphabetic
  200.     syn keyword fvwmKeyword    NoTitle NoWarp OLDecor Once OnlyIcons
  201.     syn keyword fvwmKeyword    OnlyNormal OnlyOnTop OnlySticky
  202.     syn keyword fvwmKeyword    OnTop Pixmap PopupDelay PopupDelayed
  203.     syn keyword fvwmKeyword    PopupImmediately PopupOffset Quiet
  204.     syn keyword fvwmKeyword    Raised RecaptureHonorsStartsOnPage
  205.     syn keyword fvwmKeyword    RecaptureIgnoresStartsOnPage Rectangle
  206.     syn keyword fvwmKeyword    Reset Right RightJustified Root
  207.     syn keyword fvwmKeyword    SameType SelectInPlace SelectWarp
  208.     syn keyword fvwmKeyword    SeparatorsLong SeparatorsShort ShowMapping
  209.     syn keyword fvwmKeyword    SideColor SidePic Simple SkipMapping
  210.     syn keyword fvwmKeyword    Slippery SlipperyIcon SloppyFocus
  211.     syn keyword fvwmKeyword    SmartPlacement SmartPlacementIsNormal
  212.     syn keyword fvwmKeyword    SmartPlacementIsReallySmart Solid
  213.     syn keyword fvwmKeyword    South Southeast Southwest StartIconic
  214.     syn keyword fvwmKeyword    StartNormal StartsAnyWhere StartsOnDesk
  215.     syn keyword fvwmKeyword    StartsOnPage StaysOnTop StaysPut
  216.     syn keyword fvwmKeyword    Sticky StickyIcon StipledTitles Sunk
  217.     syn keyword fvwmKeyword    TiledPixmap Title TitleUnderlines0
  218.     syn keyword fvwmKeyword    TitleUnderlines1 TitleUnderlines2
  219.     syn keyword fvwmKeyword    TitleWarp TitleWarpOff Top Transient
  220.     syn keyword fvwmKeyword    TrianglesRelief TrianglesSolid Up
  221.     syn keyword fvwmKeyword    UseBorderStyle UseDecor UseIconName
  222.     syn keyword fvwmKeyword    UsePPosition UseStyle UseTitleStyle
  223.     syn keyword fvwmKeyword    Vector VGradient Warp WarpTitle West
  224.     syn keyword fvwmKeyword    WIN WindowListHit WindowListSkip Windows
  225. endif
  226.  
  227. if version >= 508 || !exists("did_fvwm_syntax_inits")
  228.     if version < 508
  229.     let did_fvwm_syntax_inits = 1
  230.     command -nargs=+ HiLink hi link <args>
  231.     else
  232.     command -nargs=+ HiLink hi def link <args>
  233.     endif
  234.  
  235.     HiLink fvwmComment        Comment
  236.     HiLink fvwmEnvVar        Macro
  237.     HiLink fvwmExec        Function
  238.     HiLink fvwmFunction        Function
  239.     HiLink fvwmIcon        Comment
  240.     HiLink fvwmKey        Function
  241.     HiLink fvwmKeyword        Keyword
  242.     HiLink fvwmMenuString    String
  243.     HiLink fvwmModConf        Macro
  244.     HiLink fvwmModule        Function
  245.     HiLink fvwmRGBValue        Type
  246.     HiLink fvwmShortcutKey    SpecialChar
  247.     HiLink fvwmString        String
  248.  
  249.     if exists("rgb_file")
  250.     HiLink fvwmColors    Type
  251.     endif
  252.  
  253.     delcommand HiLink
  254. endif
  255.  
  256. let b:current_syntax = "fvwm"
  257. " vim: sts=4 sw=4 ts=8
  258.